home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / scheme / scm / xscm.lha / xscm / xhello.scm < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.0 KB  |  36 lines

  1. ; $Header: /home/campbell/Languages/Scheme/scm/x-scm/RCS/xhello.scm,v 1.1 1992/07/03 03:06:52 campbell Beta $
  2. ;
  3. ; "Hello, world" button sample program for xmscm
  4. ;
  5. ;  Author: Larry Campbell (campbell@redsox.bsw.com)
  6. ;  Copyright 1992 by The Boston Software Works, Inc.
  7. ;  Permission to use for any purpose whatsoever granted, as long
  8. ;  as this copyright notice remains intact.  Please send bug fixes
  9. ;  or enhancements to the above email address.
  10. (require (in-vicinity (library-vicinity) "x11.scm"))
  11. (require (in-vicinity (library-vicinity) "xt.scm"))
  12. (require (in-vicinity (library-vicinity) "xm.scm"))
  13.  
  14. (define top-level
  15.   (xt:initialize "hello" "Hello"))
  16.  
  17. (define button
  18.   (xt:create-managed-widget
  19.    "Hello" xm:push-button top-level))
  20.  
  21. (xt:add-callback
  22.  button xm:n-activate-callback
  23.  (let ((toggled #f))
  24.    (lambda (widget)
  25.      (if toggled
  26.      (quit)
  27.      (begin
  28.        (xt:set-values
  29.         widget xm:n-label-string (xm:string-create "Goodbye!"))
  30.        (set! toggled #t))))))
  31.  
  32. (xt:realize-widget top-level)
  33. (xt:main-loop)
  34.